DEFINITION MODULE GEMDOS;

(*
 *  Copyright (c) 1987,1988,1989 by
 *  ana-systems, Foster City, California.
 *  All Rights Reserved.
 *
 *  This software is furnished under a license and may be used and copied
 *  only  in accordance with  the  terms  of  such  license and  with the
 *  inclusion of the above copyright notice.  This software or  any other
 *  copies thereof may not be provided or otherwise made available to any
 *  other  person.   No title to and ownership of the  software is  herby
 *  transferred.
 *
 *  The information in this software is  subject to change without notice
 *  and  should  not be construed as a commitment by ana-systems.   No
 *  warranty is implied or expressed.
 *)

FROM SYSTEM IMPORT ADDRESS,CODE,REGISTER;

EXPORT QUALIFIED isatty,Pterm0,Cconin,Cconout,Cauxin,Cauxout,Cprnout,
				 Crawio,Crawcin,Cnecin,Cconws,Cconrs,Cconis,Dsetdrv,
				 Cconos,Cprnos,Cauxis,Cauxos,Dgetdrv,Fsetdta,Super,
				 Tgetdate,Tsetdate,Tgettime,Tsettime,Fgetdta,Sversion,
				 Ptermres,Dfree,Dcreate,Ddelete,Dsetpath,Fcreate,Fopen,
				 Fclose,Fread,Fwrite,Fdelete,Fseek,Fattrib,Fdup,Fforce,
				 Dgetpath,Malloc,Mfree,Mshrink,Pexec,Pterm,Fsfirst,
				 Fsnext,Frename,Fdatime,errno,ciPermissionNum,
                 ciORDONLY,ciOWRONLY,ciORDWR,ciONDELAY,ciOAPPEND,
                 ciOCREAT, ciOTRUNC, ciEXCLU,ciOCONTIG,ciSTDIN,
                 ciSTDOUT, ciSTDERR;

CONST

 (* defines for ATARI calls *)
 (* open modes *)
  ciORDONLY =    0B;    (* open only *)
  ciOWRONLY =    1B;    (* open only *)
  ciORDWR   =    2B;
  ciONDELAY =    4B;
  ciOAPPEND =   10B;
  ciOCREAT  = 400B;     (* open only *)
  ciOTRUNC  = 1000B;    (* open only *)
  ciEXCLU   = 2000B;    (* open only *)
  ciOCONTIG = 4000B;    (* open only *)

  ciPermissionNum = 00H;

  ciSTDIN  = 0;                 (* For Gemdos Standard Input *)
  ciSTDOUT = 1;                 (* For Gemdos Standard Output *)
  ciSTDERR = 1;                 (* For Gemdos Standard error *)


VAR errno:INTEGER;

PROCEDURE isatty(lun:CARDINAL):BOOLEAN;

PROCEDURE Pterm0;

PROCEDURE Cconin():LONGINTEGER;

PROCEDURE Cconout(ch:CHAR);

PROCEDURE Cauxin():CHAR;

PROCEDURE Cauxout(ch:CHAR);

PROCEDURE Cprnout(ch:CHAR):INTEGER;

PROCEDURE Crawio(ch:CHAR):INTEGER;

PROCEDURE Crawcin():LONGINTEGER;

PROCEDURE Cnecin():LONGINTEGER;

PROCEDURE Cconws(str:ADDRESS):INTEGER;

PROCEDURE Cconrs(buf:ADDRESS):INTEGER;

PROCEDURE Cconis():INTEGER;

PROCEDURE Dsetdrv(drive:INTEGER):LONGINTEGER;

PROCEDURE Cconos():INTEGER;

PROCEDURE Cprnos():INTEGER;

PROCEDURE Cauxis():INTEGER;

PROCEDURE Cauxos():INTEGER;

PROCEDURE Dgetdrv():INTEGER;

PROCEDURE Fsetdta(buffer:ADDRESS);

PROCEDURE Super(stack:ADDRESS):ADDRESS;

PROCEDURE Tgetdate():INTEGER;

PROCEDURE Tsetdate(date:INTEGER);

PROCEDURE Tgettime():INTEGER;

PROCEDURE Tsettime(date:INTEGER);

PROCEDURE Fgetdta():ADDRESS;

PROCEDURE Sversion():INTEGER;

PROCEDURE Ptermres(progSize:LONGINTEGER; exitCode:INTEGER);

PROCEDURE Dfree(buf:ADDRESS; drive:INTEGER);

PROCEDURE Dcreate(path:ADDRESS):INTEGER;

PROCEDURE Ddelete(path:ADDRESS):INTEGER;

PROCEDURE Dsetpath(path:ADDRESS):INTEGER;

PROCEDURE Fcreate(path:ADDRESS; attr:INTEGER):INTEGER;

PROCEDURE Fopen(path:ADDRESS; attr:INTEGER):INTEGER;

PROCEDURE Fclose(fd:INTEGER):INTEGER;

PROCEDURE Fread(fd:INTEGER; count:LONGINTEGER; buffer:ADDRESS):LONGINTEGER;

PROCEDURE Fwrite(fd:INTEGER; count:LONGINTEGER; buffer:ADDRESS):LONGINTEGER;

PROCEDURE Fdelete(path:ADDRESS):INTEGER;

PROCEDURE Fseek(offset:LONGINTEGER; fd,mode:INTEGER):LONGINTEGER;

PROCEDURE Fattrib(fname:ADDRESS; mode,newAttrib:INTEGER):INTEGER;

PROCEDURE Fdup(handle:INTEGER):INTEGER;

PROCEDURE Fforce(stdFile,userFile:INTEGER):INTEGER;

PROCEDURE Dgetpath(buff:ADDRESS; drive:INTEGER):INTEGER;

PROCEDURE Malloc(count:INTEGER):ADDRESS;

PROCEDURE Mfree(addr:ADDRESS):INTEGER;

PROCEDURE Mshrink(dummy:INTEGER; startAddr:ADDRESS; size:LONGINTEGER):INTEGER;

PROCEDURE Pexec(mode:INTEGER; path,cmdln,env:ADDRESS):ADDRESS;

PROCEDURE Pterm(code:INTEGER);

PROCEDURE Fsfirst(path:ADDRESS; attr:INTEGER):INTEGER;

PROCEDURE Fsnext():INTEGER;

PROCEDURE Frename(dummy:INTEGER; oldpath,newpath:ADDRESS):INTEGER;

PROCEDURE Fdatime(dateBuf:ADDRESS; handle,mode:INTEGER);

END GEMDOS.
